package com.mujin.keji.collectionsystem.module.sign.respository;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;

import com.mujin.keji.collectionsystem.base.BaseDto;
import com.mujin.keji.collectionsystem.base.CommonRepository;
import com.mujin.keji.collectionsystem.db.dao.SignDao;
import com.mujin.keji.collectionsystem.db.database.AppDataBase;
import com.mujin.keji.collectionsystem.db.domain.SignBean;
import com.mujin.keji.collectionsystem.module.sign.dto.SignDetailDto;
import com.mujin.keji.collectionsystem.module.sign.vo.SignDetailVo;

import java.util.List;

import io.reactivex.Flowable;

/**
 * 签到详情Repository
 *
 * @author weishixiong
 * @Time 2018-04-28
 */
public class SignDetailRepository extends CommonRepository<SignDetailDto> implements ISignDetailRepository {
    @Override
    public LiveData<BaseDto<SignDetailDto>> signDetail(SignDetailVo vo, Context context) {

        SignDao signDao = AppDataBase.getInstance(context).getSignDao();

        Flowable<List<SignBean>> lists = signDao.findSignDetail();

        MutableLiveData data = new MutableLiveData();

        data.setValue(lists);

        return data;

//        return request(Api.signGetDate(vo)).send().get();
    }
}
